PChange(const char * sFindWhat, const char * sChangeTo, short cSearchRange, PMBool
bWrapAround, PMBool bMatchCase, PMBool bWholeWord, PMBool bClearAttr);
Story editor only. The PChange command works only in story editor. Use the PEditStory command to invoke the story editor.const char * sFindWhat;
Text to search for.const char * sChangeTo;
Replacement text.short cSearchRange;
kFCSSelectedText to search selected text
kFCSCurrentStory to search current story only, starting from position of insertion point (default setting)
kFCSAllStories to search all stories in current publication, starting from beginning of currently active story
kParmDefault to use default or previously defined range
kParmDontCare to let system choose range based on current text selection. If text is selected, the PChange command searches only selected text; if no text is selected, it searches only the current story, starting from position of insertion point.PMBool bWrapAround;
false to stop searching when PageMaker reaches end of story
true to continue searching from beginning of story when PageMaker reaches end of story (default setting)PMBool bMatchCase;
true to turn off case-sensitive searching (default setting)
true to turn on case-sensitive searching (to match capitalization of search text exactly)PMBool bWholeWord;
false to search for any occurrence of specified text (default setting), even if text is found within another word (for example, searching for "story" could yield "history," as well as "story")
true to search for specified text as a whole word only, disregarding occurrences where text is embedded within another word.PMBool bClearAttr;
false to use existing text and paragraph attributes (default setting)
true to clear all attribute settings (both Find and Change settings).
Current publication only. Unlike the Change dialog box, the PChange command cannot search multiple publications. It can search only the stories in the currently active publication.
Change next. The PChange command locates and changes only one instance of the search text. You must repeat the command, or better yet, use the PChangeNext command, to find and change the next occurrence of the search text. Use the PChangeAll command to find and change all occurrences of the search text.
bWrapAround. PageMaker disregards the bWrapAround parameter in two cases, when cSearchRange is set to either:
Setting text and paragraph attributes. To search for and replace text and paragraph attributes (e.g., font, type size, paragraph style), use the PFindTypeAttr1, PFindTypeAttr2, PFindParaAttr, PChangeTypeAttr1, PChangeTypeAttr2, and PChangeParaAttr commands, followed by the PChange command with bClearAttr set to false.
Changing only text attributes. To change text attributes only (e.g., all 10 -point, bold text to 9-point, Helvetica bold), use the PFindTypeAttr1, PFindTypeAttr2, PChangeTypeAttr1, and PChangeTypeAttr2 commands to set the desired attributes. (Be sure to clear the paragraph attributes with the PFindParaAttr and PChangeParaAttr commands.) Then, using the PChange command, specify an empty string for both sFindWhat and sChangeTo and set bClearAttr to useattributes or 0. For example, to change all 10-point, bold text in a publication to 9-point, Helvetica bold, the commands are:
PFindTypeAttr2(-3, -3, "Any", -3); // to clear the other type attributes PChangeTypeAttr2(-3, -3, "Any", -3); // to clear the other type attributes PFindParaAttr("Any", -3, -3); // to clear the paragraph attributes PChangeParaAttr("Any", -3, -3); // to clear the paragraph attributes PFindTypeAttr1("Any", 10, -3, kStyleBold, -3, -3); PChangeTypeAttr1("Helvetica", 9, -3, kStyleBold, -3, -3); PChange("", "", kFCSAllStories, false, false, false, false);
Searching for and changing special characters. You enter a special character as part of your search or replacement text using the same key combinations that you type directly in the Change dialog box. Refer to Adobe PageMaker 6.5 Help > Shortcuts > Special Characters.
Scripts palette. Do not use the PChange command in scripts you plan to run using the Scripts palette. When PageMaker finds no match or completes the search, the Scripts palette interprets this as an error and stops at that point in the script.
Exceptions. There are two common situations which will result in an exception being thrown by the constructor:
PSelect(1);
// select story
// insert insertion point into beginning of selected
story
PTextEdit();
// switch to story editor
PEditStory();
PChangeAll("rumba", "cha-cha", kFCSCurrentStory, kFCAnyCase,
kFCWholeWord, kFCClear);
The PGetChangeParaAttr, PGetChangeTypeAttr1, PGetChangeTypeAttr2, PGetChangeWindow, PGetFindParaAttr, PGetFindTypeAttr1, PGetFindTypeAttr2, and PGetFindWindow queries
Adobe PageMaker 6.5 Help > Commands > Utilities > Change
Adobe PageMaker 6.5 Help > Shortcuts > Special Characters
Comments or suggestions? Contact Adobe Developer Support